﻿@model RonYee.Models.MvcPage
@{
    ViewBag.Title = "图书列表";
    Layout = "~/Views/Shared/_LayoutOfSecondPage.cshtml";
}
<script type="text/javascript">

    function getAjaxPageDate(CurrentPageIndex) {
        var dataStr = "CurrentPageIndex=" + CurrentPageIndex;
        $.ajax({
            type: "POST",
            url: "/Book/PageIndex",
            data: dataStr,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
            async: false, // 同步  true 异步。默认是异步
            error: function (datas) {
                alert(datas);
            },
            success: function (data) {
                $('#content').html(data);
            }
        });
    }
</script>
<div class="box_padding" id="content">
    <h3>
        <i class="ui-icons"></i>检索图书</h3>
    <div class="box_top ui-icons">
    </div>
    <div class="box_bg">
        <div class="box_padding">
            <div class="border_line">
                @using (Html.BeginForm("Search", "Book", FormMethod.Post))
                {
                    <table width="100%" border="0" id="MyTable" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td class="tdName">
                                    ISBN
                                </td>
                                <td class="tdData">
                                    <input type="text" id="s_isbn" name="s_isbn" />
                                </td>
                                <td class="tdName">
                                    书名
                                </td>
                                <td class="tdData">
                                    <input type="text" id="s_name" name="s_name" />
                                </td>
                            </tr>
                            <tr>
                                <td class="tdData">
                                </td>
                                <td class="tdData">
                                </td>
                                <td class="tdData">
                                </td>
                                <td class="tdData">
                                    <input type="submit" value="查询》" class="Button1 ui-icons" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    
                }
            </div>
        </div>
    </div>
    <div class="box_down ui-icons">
    </div>
    @using (Html.BeginForm("PageIndex", "Book", FormMethod.Post))
    { 
        <h3>
            <i class="ui-icons"></i>图书列表</h3>
        <div class="box_top ui-icons">
        </div>
        <div class="box_bg">
            <div class="box_padding">
                <div class="border_line">
                    <p>
                        <a href="@Url.Action("SetPercent")">
                            <input class="Button1 ui-icons" type="button" value="设置图书折价比率" name="SetPercentUrl" /></a>
                    </p>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <th class="tdName">
                                    ISBN
                                </th>
                                <th class="tdName">
                                    书名
                                </th>
                                <th class="tdName">
                                    出版社
                                </th>
                                <th class="tdName">
                                    版本号
                                </th>
                                <th class="tdName">
                                    作者
                                </th>
                                <th class="tdName">
                                    库存数
                                </th>
                                <th class="tdName">
                                    原价
                                </th>
                                <th class="tdName">
                                    现价
                                </th>
                                <th class="tdName">
                                    编辑
                                </th>
                                <th class="tdName">
                                    详细
                                </th>
                                <th class="tdName">
                                    删除
                                </th>
                            </tr>
                            @foreach (RonYee.Models.Book item in Model.BookList)
                            {
                                <tr>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.ISBN)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.BookName)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.Publisher)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.PublishNum)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.Author)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.BookCount)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.OriginalPrice)
                                    </td>
                                    <td class="tdData">
                                        @Html.DisplayFor(modelItem => item.CurrentPrice)
                                    </td>
                                    <td class="tdData">
                                        @Html.ActionLink("编辑", "Edit", new { id = item.BookId })
                                    </td>
                                    <td class="tdData">
                                        @Html.ActionLink("详细", "Details", new { id = item.BookId })
                                    </td>
                                    <td class="tdData">
                                        @Html.ActionLink("删除", "Delete", new { id = item.BookId })
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                    <center>@Html.Partial("~/Views/Shared/_PageIndex.cshtml", Model)</center>
                </div>
            </div>
        </div>
        <div class="box_down ui-icons">
        </div>
    }
</div>
<div class="line_top">
</div>
